package com.github.cyf.common.util;

import com.github.cyf.entity.User;
import java.nio.file.Paths;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;

/**
 * @author chenyifan
 * @create 2024-04-02 9:35
 */
public class DataUtil {

    public static final String EXPORT_PATH = "E:/test/excel/export";

    public static List<User> getUserList() {
        List<User> userList = new ArrayList<>();
        userList.add(new User(1, "abc", 99, "北京"));
        userList.add(new User(2, "lol", 77, "上海"));
        userList.add(new User(3, "qaq", 88, "深圳"));
        userList.add(new User(4, "owo", 66, "杭州"));
        return userList;
    }

    public static String getExportPath() {
        String dateTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd-HH-mm-ss"));
        return Paths.get(DataUtil.EXPORT_PATH, dateTime + ".xlsx").toString();
    }
}
